<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="template.xhtml">
	<ui:define name="content">
		<h:form id="form">

			<p:growl id="messages" showDetail="true" />

			<p:dataTable var="term" value="#{dictionaryControler.termList}"
				id="termList" editable="true" filteredValue="#{dictionaryControler.filteredTerms}">

				<f:facet name="header">
            		Glossary
        		</f:facet>

				<p:ajax event="rowEdit" listener="#{dictionaryControler.onEdit}"
					update=":form:messages" />
				<p:ajax event="rowEditCancel"
					listener="#{dictionaryControler.onCancel}" update=":form:messages" />

				<p:column headerText="KEY" style="width:30%" filterBy="#{term.key}"
					footerText="contains" filterMatchMode="contains">
					<h:outputText value="#{term.key}" />
				</p:column>

				<p:column headerText="VALUE" style="width:30%" filterBy="#{term.value}"
					footerText="contains" filterMatchMode="contains">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{term.value}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{term.value}" style="width:100%" />
						</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column style="width:6%">
					<p:rowEditor />
				</p:column>

			</p:dataTable>

		</h:form>
	</ui:define>
</ui:composition>
</html>